﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FireStarterModeller.BO;
using Habanero.BO;
using Microsoft.Practices.Unity;
using System.Diagnostics;
using Rhino.Mocks;

namespace FireStarterModeller.Test
{
    public class AutoMockingUnityContainer : UnityContainer
    {
        public override object Resolve(Type t, string name)
        {
            try
            {
                return base.Resolve(t, name);
            }
            catch (ResolutionFailedException)
            {
                //Debug.WriteLine(string.Format("AutoMocking - Reolved type:{0}", t));
                return MockRepository.GenerateStub(t, null);
            }
        }
    }
}